/**
 * @param {前进（1）/后退（2）} type
 * @param {当前页面内容} arr
 * @param {前进后退步数} idx
 */
function PageSet(type, arr, idx) {
  const PageData = JSON.parse(localStorage.getItem('page'));
  const nowdata = arr;
  let nowArr = [];
  if (type === 2) {
    nowdata.splice(nowdata.length - 1, idx);
    nowArr = nowdata[nowdata.length - 1];
  } else {
    const num = PageData.length - arr.length;
    const data = PageData.slice(num + 1);
    // num++;
    nowArr = data[0];
  }
  return nowArr;
}
export { PageSet }
